<template>
	<view id="app">
		<!-- 推销管理 -->
		<view class="topBg oh plr30">
			<!-- 信息 -->
			<view class="rows oh mt30">
				<!-- 个人信息 -->
				<view class="col oh f1 df aic">
					<view class="avatar wh110">
						<image :src="wrap.avatar ? wrap.avatar : '/static/no.png'" mode="aspectFill"></image>
					</view>
					<view class="info f1 oh ml20 c000">
						<view class="f40 pb10 thd fwb">{{wrap.nickname}}</view>
						<view class="f30">{{wrap.mobile}}</view>
					</view>
				</view>
			</view>
		</view>

		<!-- 团队管理 -->
		<view class="team area mlr30 plr30">
			<!-- 标题 -->
			<view class="title rows ptb20 bdb1sE">
				<view class="txt c333 f30">团队管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</view>

			<!-- nav -->
			<view class="navArea rows pt20 pb30 cw">

				<!-- <navigator hover-class="none" url="/pages/my/setting/team" class="bar1 area pr f1">
					<view class="wrap pmid df aic">
						<view class="img wh50">
							<image src="/static/set1.png" mode="aspectFit"></image>
						</view>
						<view class="txt ml20 f32 wsn">推销团队</view>
					</view>
				</navigator> -->

				<navigator hover-class="none" url="/pages/my/setting/result" class="bar2 area pr f1 ">
					<view class="wrap pmid df aic">
						<view class="img wh50">
							<image src="/static/set2.png" mode="aspectFit"></image>
						</view>
						<view class="txt ml20 f32 wsn">推销成果</view>
					</view>
				</navigator>

			</view>
		</view>

		<!-- 商品管理 -->
		<view class="mOrder area mt30 mlr30 plr30">
			<!-- 标题 -->
			<view class="title rows ptb20 bdb1sE">
				<view class="txt c333 f30">商品管理</view>
				<view class="icon">
					<uni-icons type="arrowright" color="#404e60"></uni-icons>
				</view>
			</view>
			<!-- 内容 -->
			<view class="wrap df dfsa aic pt50 ptb30 f26">
				<!-- 全部订单 -->
				<navigator hover-class="none" url="/pages/my/setting/prolist?type=1" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order1.png" mode="aspectFit"></image>
						<view class="script">
							{{num}}
						</view>
					</view>
					<view class="txt mt10">全部订单</view>
				</navigator>

				<!-- 待处理 -->
				<navigator hover-class="none" url="/pages/my/setting/prolist?type=2" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order6.png" mode="aspectFit"></image>
						<view class="script">
							{{num1}}
						</view>
					</view>
					<view class="txt mt10">待处理</view>
				</navigator>

				<!-- 待发货 -->
				<navigator hover-class="none" url="/pages/my/setting/prolist?type=3" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order7.png" mode="aspectFit"></image>
						<view class="script">
							{{num2}}
						</view>
					</view>
					<view class="txt mt10">待发货</view>
				
				</navigator>

				<!-- 合作中 -->
				<navigator hover-class="none" url="/pages/my/setting/prolist?type=4" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order8.png" mode="aspectFit"></image>
						<view class="script">
							{{num3}}
						</view>
					</view>
					<view class="txt mt10">合作中</view>
			
				</navigator>

				<!-- 已结束 -->
				<navigator hover-class="none" url="/pages/my/setting/prolist?type=5" class="list df dfc aic">
					<view class="img wh50">
						<image src="/static/order4.png" mode="aspectFit"></image>
						<view class="script">
							{{num4}}
						</view>
					</view>
					<view class="txt mt10">已结束</view>
				
				</navigator>
			</view>
		</view>

	</view>
</template>
<script>
	// 设置页面变量
	var that;
	export default {
		// 页面变量
		data() {
			return {
				// 建立页面数据
				wrap: {},
				num:0,
				num1:0,
				num2:0,
				num3:0,
				num4:0,
			}
		},

		// 获取后
		onLoad() {
			that = this;
		},

		// 页面出现
		onShow() {
			// 获取用户信息
			that.getuserinfo();
			that.getordernum()
		},

		// 方法列表
		methods: {
		
		//获取订单表头数据
		getordernum() {
			console.log(2);
			var that = this
			// 请求接口
			that.request({
				url: '/api/index/promotenum',
				// 上传数据
				data: {
					token: uni.getStorageSync('token'),
				},
				// 调用成功
				success(rs) {
					// 返回成功
					if (rs.code == 1) {
						console.log(rs);
						that.num = rs.data[0]
						that.num1 = rs.data[1]
						that.num2 = rs.data[2]
						that.num3 = rs.data[3]
						that.num4 = rs.data[4]
					}
				}
			})
		},
			// 获取用户信息
			getuserinfo() {
				// 获取用户信息
				that.util.getuserinfo((rs) => {
					// 获取用户信息
					that.wrap = rs.data.userinfo;
				})
			},
		},

	}
</script>
<style lang="less">
	/* 顶部 */
	.topBg {
		height: 300rpx;
	}

	/* 团队 */
	.team {
		margin-top: -130rpx;
	}
	.img {
		position: relative;
	}
	
	.script {
		position: absolute;
		top: -10rpx;
		right: -10rpx;
		background-color: red;
		color: #fff;
		height: 30rpx;
		line-height: 30rpx;
		padding: 0 8rpx;
		font-size: 20rpx;
		border-radius: 50%;
	}

	/* 导航区 */
	.navArea {

		// 推销团队
		.bar1 {
			height: 120rpx;
			background: linear-gradient(180deg, #93E9C7 0%, #5CC4A0 100%);
		}

		// 推销成果
		.bar2 {
			height: 120rpx;
			background: linear-gradient(180deg, #FFCAA7 0%, #FFA37A 100%);
		}
	}
</style>
